package com.code.constant;

import java.util.Arrays;

public enum BooleanEnum {

    YES("是", true),
    NULL("", false),
    NO("否", false);

    private final String excelData;
    private final Boolean nullState;

    BooleanEnum(String excelData, Boolean nullState) {
        this.excelData = excelData;
        this.nullState = nullState;
    }


    public static boolean getBoolean(String excelData) {
        return Arrays.stream(values()).filter(
            dataTypeEnum -> dataTypeEnum.excelData.equals(excelData)
        ).findFirst().get().nullState;
    }

    public String getExcelData() {
        return excelData;
    }

    public Boolean getNullState() {
        return nullState;
    }

}
